package com.wxltsoft.commons.utils;

import java.util.List;

import net.sf.json.JSONObject;

public class JSONUtils {
	
	public final static JSONObject EMPTY_JSON_OBJECT = new JSONObject();
	
	private final static String SUCCESS_STATUS = "success";
	
	private final static String DATA_TOTAL = "total";
	
	private final static String DATA_ROWS = "rows";
	
	public static JSONObject getPageJSON(List<? extends Object> list , int count) {
		JSONObject object = new JSONObject();
        object.put(SUCCESS_STATUS , true);
        object.put(DATA_TOTAL , count);
        object.put(DATA_ROWS , list);
        return object;
	}

}
